package com.zhufeng.jvm.classloader;

import java.lang.reflect.Method;

public class MyTest20 {

	public static void main(String[] args) throws Exception {
		MyTest16 load1 = new MyTest16("load1");
		MyTest16 load2 = new MyTest16("load2");

		load1.setLoadPath("/Users/zhufeng/Desktop/");
		load2.setLoadPath("/Users/zhufeng/Desktop/");

		Class<?> clazz1 = load1.loadClass("com.zhufeng.jvm.classloader.MyPerson");
		Class<?> clazz2 = load2.loadClass("com.zhufeng.jvm.classloader.MyPerson");

		System.out.println("clazz1 = clazz2: " + (clazz1 == clazz2));

		Object object1 = clazz1.newInstance();
		Object object2 = clazz2.newInstance();

		Method method = clazz1.getMethod("setMyPerson", Object.class);
		method.invoke(object1, object2);
	}

}
